package edu.indiana.cs.b534.torrent.context;

import edu.indiana.cs.b534.torrent.impl.PeerInstance;

public class RequestBean {
	private int pieceIndex;
	private int begin;
	private int length;
	private PeerInstance peerInstance;
	private int retryCount = 1;
	public int getRetryCount() {
		return retryCount;
	}
	public RequestBean(int pieceIndex, PeerInstance peerInstance,int begin,int length) {
		super();
		this.pieceIndex = pieceIndex;
		this.peerInstance = peerInstance;
		this.begin = begin;
		this.length = length;
	}
	public PeerInstance getPeerInstance() {
		return peerInstance;
	}
	public int getPieceIndex() {
		return pieceIndex;
	}
	public int getBegin() {
		return begin;
	}
	public int getLength() {
		return length;
	}
	public synchronized void reduceRetryCount(){
		this.retryCount--;
	}
}
